<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
<title>产品管理</title>
<meta name="decorator" content="default" />
<script src="/jeesite/static/jquery-validation/1.11.1/localization/messages_zh.js"></script>
<script type="text/javascript">
/* $.validator.setDefaults({
    submitHandler: function() {
      alert("提交事件!");
    }
}); */
$().ready(function() {
    $("#inputForm").validate();
});
</script>
</head>
<body>
	
	<ul class="nav nav-tabs">
		<li><shiro:hasPermission name="cg:component:viewComponentList"><a href="${ctx}/cg/component/">元器件列表</a></shiro:hasPermission></li>
		<li class="active">
		<a href="${ctx}/cg/component/form?id=${component.id}">产品
		<shiro:hasPermission name="cg:component:edit">${not empty component.id?'修改':'添加'}</shiro:hasPermission>
		<shiro:lacksPermission name="cg:component:edit">查看</shiro:lacksPermission></a></li>
		<li><shiro:hasPermission name="cg:component:viewComponentRecord"><a href="${ctx}/cg/componentRecord">元器件出入库记录</a></shiro:hasPermission></li>
	</ul>
	<br />
	
	<%-- <div class="header">
		<div id="messageBox" class="alert alert-error ${empty message ? 'hide' : ''}"><button data-dismiss="alert" class="close">×</button>
			<label id="loginError" class="error">${message}</label>
		</div>
	</div> --%>
	<form:form id="inputForm" modelAttribute="component"
		action="${ctx}/cg/component/save" method="post"
		class="form-horizontal">
		<form:hidden path="id" />
		<sys:message content="${message}" />


		<div class="control-group">
			<label class="control-label">元件名称：</label>
			<div class="controls">
				<form:input path="name" htmlEscape="false" maxlength="100" class="required"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">型 号：</label>
			<div class="controls">
				<form:input path="model" htmlEscape="false" maxlength="100" class="required"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">封装方式：</label>
			<div class="controls">
			<form:input path="pack" htmlEscape="false" maxlength="100" class="required"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">规 格：</label>
			<div class="controls">
					<form:input path="spec" htmlEscape="false" maxlength="100" class="required"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">库 位：</label>
			<div class="controls">
				<form:input path="location" htmlEscape="false" maxlength="100" class="required"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">库存数量：</label>
			<div class="controls">
			<form:input path="repertoryNum" htmlEscape="false" maxlength="100" class="required"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">单 位：</label>
			<div class="controls">
				<form:input path="unit" htmlEscape="false" maxlength="100" />
			</div>
		</div>

		<div class="control-group">
			<label class="control-label">安全库存：</label>
			<div class="controls">
				<form:input path="repertoryNumSafety" htmlEscape="false" maxlength="100" class="required"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">备 注：</label>
			<div class="controls">
				<form:textarea path="remarks" htmlEscape="false" rows="4"
					maxlength="255" class="input-xxlarge " />
			</div>
		</div>
		<div class="form-actions">
			<shiro:hasPermission name="cg:component:edit">
				<input id="btnSubmit" class="btn btn-primary" type="submit"
					value="保 存" />&nbsp;</shiro:hasPermission>
			<input id="btnCancel" class="btn" type="button" value="返 回"
				onclick="history.go(-1)" />
		</div>
	</form:form>

</body>
</html>